package com.wrx.server.controller;


import com.wrx.server.pojo.Collect;
import com.wrx.server.pojo.CollectBar;
import com.wrx.server.pojo.RespBean;
import com.wrx.server.service.ICollectService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author wrx
 * @since 2021-04-20
 */
@RestController
//@RequestMapping("/servecollect")
public class CollectController{

    @Autowired
    ICollectService collectService;

    @ApiOperation(value = "收藏主题帖")
    @PostMapping("/collect/theme-post")
    public RespBean AddCollectThemePost(@RequestBody Collect collect, HttpServletRequest request){

        return collectService.addCollectThemePost(collect,request);

    }

    @ApiOperation(value = "取消收藏主题帖")
    @PostMapping("/collect/delCollect-themePost")
    public RespBean delCollectThemePost(@RequestBody Collect collect, HttpServletRequest request){

        return collectService.delCollectThemePost(collect,request);

    }

    @ApiOperation(value = "关注一个吧")
    @PostMapping("/collect/bar")
    public RespBean AddCollectBar(@RequestBody CollectBar collectBar, HttpServletRequest request){

        return collectService.addCollectBar(collectBar,request);

    }

    @ApiOperation(value = "取消关注一个吧")
    @PostMapping("/collect/del-bar")
    public RespBean delCollectBar(@RequestBody CollectBar collectBar, HttpServletRequest request){

        return collectService.delCollectBar(collectBar,request);

    }

}
